﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Vouchers;
using Lists;
using BasicForms;


namespace BanLe
{
    public partial class FrmDanhSachHoaDonBanLe : BasicForms.FrmDanhSachChungTu
    {
        public FrmDanhSachHoaDonBanLe()
        {
            InitializeComponent();
            _DieuKienTimKiem.LoaiChungTu = DanhMucLoaiChungTu.Instance.GetByMa("HoaDonBanLe");
        }

        void frm_RequestAddNew()
        {
           
        }

        public override void CreateNew()
        {
            //try
            //{
            //    FrmEditHoaDonBanLe frm = new FrmEditHoaDonBanLe(_DanhSachChungTu.CreateNew(_DieuKienTimKiem.LoaiChungTu));
            //    frm.RequestAddNew += new FrmEditChungTu.OnRequestAddNew(frm_RequestAddNew);
            //    frm.Show();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
        protected override void Edit()
        {
            //try
            //{
            //    ArrayList arDeletedChungTu = new ArrayList();
            //    foreach (int index in gridViewDsChungTu.GetSelectedRows())
            //    {
            //        arDeletedChungTu.Add(_DanhSachChungTu.GetByDataRow(gridViewDsChungTu.GetDataRow(index)));
            //    }
            //    gridViewDsChungTu.BeginUpdate();
            //    foreach (ChungTu chungTu in arDeletedChungTu)
            //    {
            //        FrmEditHoaDonBanLe frm = new FrmEditHoaDonBanLe(chungTu);
            //        frm.RequestAddNew += new FrmEditChungTu.OnRequestAddNew(frm_RequestAddNew);
            //        frm.Show();
            //    }
            //    gridViewDsChungTu.EndUpdate();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }

        private void FrmDanhSachHoaDonBanLe_Load(object sender, EventArgs e)
        {
            barButtonItemNew.Enabled = false;
            barButtonItemOpen.Enabled = false;
        }
    }
}
